<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Evernote Export
  
  
  
  
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  





docker-engine安装详细文档：http://docs.docker.com/installation/centos/简单步骤（基于centos7，要求系统内核3.10及以上）：1、">
<meta property="og:type" content="website">
<meta property="og:title" content="Hexo">
<meta property="og:url" content="http://yoursite.com/images/docker-summery.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Evernote Export
  
  
  
  
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  





docker-engine安装详细文档：http://docs.docker.com/installation/centos/简单步骤（基于centos7，要求系统内核3.10及以上）：1、">
<meta property="og:image" content="https://wdwiki.mapbar.com/bin/download/%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91%E7%BB%84/DockerUsage/Image.png">
<meta property="og:image" content="https://wdwiki.mapbar.com/bin/download/%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91%E7%BB%84/DockerUsage/Image2.png">
<meta property="og:image" content="https://wdwiki.mapbar.com/bin/download/%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91%E7%BB%84/DockerUsage/Image3.png">
<meta property="og:updated_time" content="2016-01-29T17:47:36.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hexo">
<meta name="twitter:description" content="Evernote Export
  
  
  
  
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  





docker-engine安装详细文档：http://docs.docker.com/installation/centos/简单步骤（基于centos7，要求系统内核3.10及以上）：1、">
  
    <link rel="alternative" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="page-undefined" class="article article-type-page" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/images/docker-summery.html" class="article-date">
  <time datetime="2016-01-29T17:47:36.000Z" itemprop="datePublished">2016-01-30</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
    <div class="article-entry" itemprop="articleBody">
      
        <html>
<head>
  <title>Evernote Export</title>
  <basefont face="微软雅黑" size="2">
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <meta name="exporter-version" content="Evernote Windows/276152; Windows/6.1.7601 Service Pack 1;">
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="357">

<div>
<span style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><b style="font-size: 21px;">docker-engine安装</b><div style="font-size: 16px;">详细文档：<a href="http://docs.docker.com/installation/centos/" target="_blank" rel="external">http://docs.docker.com/installation/centos/</a></div><div style="font-size: 16px;"><br></div><div style="font-size: 16px;">简单步骤（基于centos7，要求系统内核3.10及以上）：</div><div><span style="font-size: 13px;">1、</span><span style="font-size: 16px;">更新系统：</span></div><div style="font-size: 13px;"><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">     sudo yum</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">update</span></div><div style="font-size: 16px;"><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">2、安装</span></div><div style="font-size: 16px;"><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">     curl -sSL http</span><span style="box-sizing: inherit; color: rgb(0, 128, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">s:</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">//</span><span style="box-sizing: inherit; color: rgb(0, 134, 179); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">get</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">.docker.</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">com</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">/ |</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">sh</span></div><div style="font-size: 13px;"><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">3、启动docker</span></div><div style="font-size: 13px;"><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     </span><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">sudo service docker start</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">4、开机启动docker</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     systemctl enable docker</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">5、额外设置信息（更改镜像安装位置，启用api）</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     vim /etc/sysconfig/docker</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     other_args=&quot;</span>H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -g /mapbar/images <span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">&quot;</span></div><div><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     centos7仅仅这么设置还不起作用， 还需要 vim</span> <font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;">/usr/lib/systemd/system/docker.service</span></font></div><div><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;">     将 ExecStart=/usr/bin/docker -d -H fd://</span></font></div><div><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;">     改为</span></font></div><div><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;">     EnvironmentFile=-/etc/sysconfig/docker      ExecStart=/usr/bin/docker -d -H fd:// $other_args</span></font></div><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;">     </span></font><div><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;">     然后 systemctl daemon-reload &amp;&amp; systemctl restart docker<br></span></font><div><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px; white-space: pre;"><br></span></font><div style="text-align: -webkit-auto; widows: 2;font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">6、重启docker</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     systemctl restart docker</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">7、docker常用命令</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     a、下载镜像（</span><a href="http://docs.docker.com/reference/commandline/pull/" target="_blank" rel="external">http://docs.docker.com/reference/commandline/pull/</a><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">）</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">          docker pull &lt;image-name&gt;</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     b、运行镜像（</span><a href="http://docs.docker.com/reference/commandline/run/" target="_blank" rel="external">http://docs.docker.com/reference/commandline/run/</a><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">）</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">          docker run ...</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     c、重启容器</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">          docker restart container_id/container_name</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     d、停止容器</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">          docker stop </span><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">container_id/container_name</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     e、删除容器</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">          docker rm</span> <span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">container_id/container_name</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">     f、查看容器输出日志(</span><a href="http://docs.docker.com/reference/commandline/logs/" target="_blank" rel="external">http://docs.docker.com/reference/commandline/logs/</a><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">)</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">          docker logs --tail 100 -f</span> <span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">container_id/container_name</span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;"><br></span></div><div style="font-size: 13px;"><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 32px; text-align: left; white-space: pre; widows: 1;">关于docker-engine的命令行，这里不在一一列举，参考：</span><a href="http://docs.docker.com/reference/commandline/cli/" target="_blank" rel="external">http://docs.docker.com/reference/commandline/cli/</a></div><div style="font-size: 13px;"><br></div><div style="font-size: 13px;"><b style="font-size: 21px;"><br></b></div><div style="font-size: 13px;"><b style="font-size: 21px;">Dockerfile</b></div><div style="font-size: 13px;"><b style="font-size: 21px;"><br></b></div><div><font size="4">Dockerfile 是一个镜像描述文件，可以用来创建新镜像。 目前创建镜像有两种方法： </font></div><div><font size="4"><br></font></div><div><font size="4">     1、 启动一个基础镜像，如centos镜像， 进入交互终端， 在里面安装服务，然后退出，提交为一个新镜像。</font></div><div><font size="4"><br></font></div><div><font size="4">     2、使用Dockerfile构建镜像： docker build -t myimage .</font></div><div><font size="4"><br></font></div><div><font size="4">第一种方法简单，但第二种方式更适合持续集成。</font></div><div><font size="4"><br></font></div><div><font size="4">先看看一个Dockerfile的实例：</font></div><div><font size="4"><br></font></div><div style="widows: 1;"><div style="text-align: left;"><table border="1" cellpadding="2" cellspacing="0" width="50%"><tbody><tr><td valign="top"><table style="box-sizing: border-box; border-collapse: collapse; border-spacing: 0px; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, &apos;Segoe UI Emoji&apos;, &apos;Segoe UI Symbol&apos;; font-size: 13px; line-height: 18.2000007629395px; text-align: start; background-color: rgb(255, 255, 255);"><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">FROM</span> debian:wheezy</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> groupadd -r mysql &amp;&amp; useradd -r -g mysql mysql</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> mkdir /docker-entrypoint-initdb.d</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db:</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># File::Basename</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># File::Copy</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># Sys::Hostname</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># Data::Dumper</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> apt-get update &amp;&amp; apt-get install -y perl --no-install-recommends &amp;&amp; rm -rf /var/lib/apt/lists/*</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># gpg: key 5072E1F5: public key &quot;MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;&quot; imported</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">ENV</span> MYSQL_MAJOR 5.7</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">ENV</span> MYSQL_VERSION 5.7.8-rc</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> echo <span style="box-sizing: border-box; color: rgb(24, 54, 145);">&quot;deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}-dmr&quot;</span> &gt; /etc/apt/sources.list.d/mysql.list</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># the &quot;/var/lib/mysql&quot; stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already &quot;configured&quot; (ie, stuff in /var/lib/mysql/mysql)</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># also, we set debconf keys to make APT a little quieter</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> { \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">echo mysql-community-server mysql-community-server/data-dir select <span style="box-sizing: border-box; color: rgb(24, 54, 145);">''</span>; \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">echo mysql-community-server mysql-community-server/root-pass password <span style="box-sizing: border-box; color: rgb(24, 54, 145);">''</span>; \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">echo mysql-community-server mysql-community-server/re-root-pass password <span style="box-sizing: border-box; color: rgb(24, 54, 145);">''</span>; \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">echo mysql-community-server mysql-community-server/remove-test-db select false; \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">} | debconf-set-selections \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">&amp;&amp; apt-get update &amp;&amp; apt-get install -y mysql-server=<span style="box-sizing: border-box; color: rgb(24, 54, 145);">&quot;${MYSQL_VERSION}&quot;</span>* &amp;&amp; rm -rf /var/lib/apt/lists/* \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">&amp;&amp; rm -rf /var/lib/mysql &amp;&amp; mkdir -p /var/lib/mysql</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># comment out a few problematic configuration values</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(150, 152, 150);"># don't reverse lookup hostnames, they are usually another container</span></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">RUN</span> sed -Ei <span style="box-sizing: border-box; color: rgb(24, 54, 145);">'s/^(bind-address|log)/#&amp;/'</span> /etc/mysql/my.cnf \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">&amp;&amp; echo <span style="box-sizing: border-box; color: rgb(24, 54, 145);">'skip-host-cache<span style="box-sizing: border-box; color: rgb(0, 134, 179);">\n</span>skip-name-resolve'</span> | awk <span style="box-sizing: border-box; color: rgb(24, 54, 145);">'{ print } $1 == &quot;[mysqld]&quot; &amp;&amp; c == 0 { c = 1; system(&quot;cat&quot;) }'</span> /etc/mysql/my.cnf &gt; /tmp/my.cnf \</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;">&amp;&amp; mv /tmp/my.cnf /etc/mysql/my.cnf</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">VOLUME</span> /var/lib/mysql</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">COPY</span> docker-entrypoint.sh /entrypoint.sh</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">ENTRYPOINT</span> [<span style="box-sizing: border-box; color: rgb(24, 54, 145);">&quot;/entrypoint.sh&quot;</span>]</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"></td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">EXPOSE</span> 3306</td></tr><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; white-space: nowrap; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; color: rgba(0, 0, 0, 0.296875); vertical-align: top; text-align: right; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(238, 238, 238); border-right-color: rgb(238, 238, 238); border-bottom-color: rgb(238, 238, 238); border-left-color: rgb(238, 238, 238); border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; cursor: pointer;"></td><td style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; overflow: visible; word-wrap: normal;"><span style="box-sizing: border-box; color: rgb(167, 29, 93);">CMD</span> [<span style="box-sizing: border-box; color: rgb(24, 54, 145);">&quot;mysqld&quot;</span>]</td></tr></tbody></table></td></tr></tbody></table><div><br></div></div><div style="text-align: left;"><br></div><div style="text-align: left;"><span style="font-size: 16px;">上面是</span><span style="font-size: 16px;">mysql官方镜像的Dockerfile， 这里解释一下是什么意思。</span></div></div><div style="text-align: left;"><br></div><div style="text-align: left;">FROM 指令， 指定使用哪个基础镜像。 这里是使用debian镜像的wheezy版本。 也可以用 FROM centos:6 表示使用centos的6版本。</div><div style="text-align: left;"><br></div><div style="text-align: left;">MAINTAINER 指令， 说明这个镜像是谁维护的。 例如 MAINTAINER <a href="mailto:docker@mapbar.com。" target="_blank" rel="external">docker@mapbar.com。</a></div><div style="text-align: left;"><br></div><div style="text-align: left;">RUN 指令， 是运行一些命令， 用法：RUN command 或者 RUN [&quot;executable&quot;, &quot;param1&quot;, &quot;param2&quot;] </div><div style="text-align: left;"><br></div><div style="text-align: left;">ENV 指令，设置环境变量。 用法 ENV &lt;key&gt; &lt;value&gt; 或者 ENV &lt;key&gt;=&lt;value&gt;， 后一种方式可以同时设置多组变量。 这些变量可以在docker build 的时候，在命令行里面替换。</div><div style="text-align: left;"><br></div><div style="text-align: left;">ADD 指令， 添加文件， 用法：ADD &lt;src&gt;... &lt;dest&gt;， 将宿主机器上面的文件添加到镜像内部，此命令可以自动解压压缩文件。此外ADD命令还可以通过URL获取远程文件。</div><div style="text-align: left;"><br></div><div style="text-align: left;">COPY 指令， 拷贝文件， 与 ADD 类似， 没有自动解压和通过URL获取远程文件的功能。</div><div style="text-align: left;"><br></div><div style="text-align: left;">VOLUME 指令，创建一个挂载点。执行docker run 的时候，可以挂载外部磁盘。</div><div style="text-align: left;"><br></div><div style="text-align: left;">EXPOSE 指令， 指定暴露哪个端口，指定docker run 的时候， 可以指定外部的端口映射。</div><div style="text-align: left;"><br></div><div style="text-align: left;">ENTRYPOINT 指令，启动镜像时候的入口。 </div><div style="text-align: left;"><br></div><div style="text-align: left;">CMD 指令， 可以认为是ENTRYPOINT 指令的参数。 这个主要目的就是在运行一个容器的时候提供默认的参数。 CMD 指令只能有一个， 多个CMD 只会有最后一个起作用。</div><div style="text-align: left;">     并且CMD之后后面的值，可以在 运行的时候被取代。</div><div style="text-align: left;"><font size="4"><br></font></div><div style="text-align: left;"><font size="4">关于Dockerfile的参考手册，参考：</font><a href="http://docs.docker.com/reference/builder/" target="_blank" rel="external">http://docs.docker.com/reference/builder/</a> 以及 <a href="http://docs.docker.com/articles/dockerfile_best-practices/" target="_blank" rel="external">http://docs.docker.com/articles/dockerfile_best-practices/</a></div><div style="text-align: left;font-size: 13px;"><b style="font-size: 21px;"><br></b></div><div style="text-align: left;font-size: 13px;"><b style="font-size: 21px;">docker-registry</b></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">docker镜像私服， 类似于maven的私服， 各个开发机器可以从这个镜像服务器拉取或者推送镜像，私服本身本质上也是一个镜像。 安装手册：<a href="https://github.com/docker/distribution/blob/master/docs/deploying.md" target="_blank" rel="external">https://github.com/docker/distribution/blob/master/docs/deploying.md</a></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">1、启动镜像服务</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">     docker run -d --name registry -v /mapbar/images:/var/lib/registry  -p 5000:5000 --restart=always registry</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">2、拉取ubuntu镜像</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">     docker pull ubuntu</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">3、给镜像打标签</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">     <span style="font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; color: rgb(51, 51, 51); widows: 1;">docker tag ubuntu myregistrydomain.com:5000/ubuntu</span></div><div style="text-align: left;font-size: 16px;"><span style="font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; color: rgb(51, 51, 51); widows: 1;"><br></span></div><div style="text-align: left;font-size: 16px;"><span style="line-height: inherit; color: rgb(51, 51, 51); widows: 1;">4、将镜像推到镜像服务器</span></div><div style="text-align: left;font-size: 16px;"><span style="line-height: inherit; color: rgb(51, 51, 51); widows: 1;">     </span></div><div style="text-align: left;font-size: 16px;"><span style="line-height: inherit; color: rgb(51, 51, 51); widows: 1;">     </span><span style="font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; color: rgb(51, 51, 51); widows: 1;">docker push myregistrydomain.com:5000/ubuntu</span></div><div style="text-align: left;font-size: 13px;"><br></div><div style="text-align: left;font-size: 16px;">5、从镜像服务器拉取ubuntu镜像</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     <span style="font-family: Consolas, &apos;Liberation Mono&apos;, Menlo, Courier, monospace; font-size: 13.6000003814697px; line-height: inherit; color: rgb(51, 51, 51); widows: 1;">docker pull myregistrydomain.com:5000/ubuntu</span></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">6、镜像服务器需要使用https 以及认证的一些配置，还会涉及到nginx 和 https 证书的配置，这个我没测试，详细的说明都在上面的安装手册里面。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><b style="font-size: 21px;">docker-swarm</b></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">详细介绍：<a href="http://docs.docker.com/swarm/" target="_blank" rel="external">http://docs.docker.com/swarm/</a></div><div style="text-align: left;font-size: 16px;">API接口文档：<a href="http://docs.docker.com/swarm/api/swarm-api/" target="_blank" rel="external">http://docs.docker.com/swarm/api/swarm-api/</a></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">docker swarm 是 docker 原生的 docker 集群管理工具。swarm现在还处于BETA版本。 它将一组docker-engine当作一个集群来管理，并且提供了 label、schedule、filter 能力 。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">swarm 保持了 docker 原有 api 的兼容， 我们可以像使用单个节点一样使用 docker 集群。 </div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">要使用 swarm， 首先要保证每个 docker-engine  节点都开启了一个 tcp 端口用于通讯（默认是2375），开启方式（centos7）：</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">     vim /etc/sysconfig/docker </div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">     在 other_args 里面添加：</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">     -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     Eg. </div><div style="text-align: left;font-size: 16px;">     <img src="https://wdwiki.mapbar.com/bin/download/%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91%E7%BB%84/DockerUsage/Image.png" type="image/png" style="cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;"></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><b>简单搭建 swarm 集群</b>：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">加入有 A、B、 C、 三台机器，要将他们作为一个集群管理， 使用节点 A 当作集群管理节点。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">首先要确保三台机器要能够互相联通（可以将防火墙关闭）。 三个节点都安装了最新的docker， 版本要一致。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">1、在 A 节点，执行下面命令， 获取一个 token ：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     docker  run  swarm  create</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">2、在 A 节点， 执行下面的命令， 将 B、C 节点加入到集群：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     docker run -d swarm join --addr=node_B_ip:2375 token://$token</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     docker run -d swarm join --addr=node_C_ip:2375 token://$token</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">3、在 A 节点， 执行下面命令， 启用集群管理：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     docker run -d -p 8888:2375 swarm manage token://$token</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">4、现在就可以使用 A 节点管理 B、C集群</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     a、查看集群中有哪些节点：</div><div style="text-align: left;font-size: 16px;">          </div><div style="text-align: left;font-size: 16px;">           docker -H 127.0.0.1:8888 info</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     b、查看节点都运行了哪些容器：</div><div style="text-align: left;font-size: 16px;">          </div><div style="text-align: left;font-size: 16px;">          docker -H 127.0.0.1:8888 ps -a</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     c、运行一个新容器：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          docker -H 127.0.0.1:8888 run...</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">如果设置了环境变量 DOCKER_HOST, 例如 export DOCKER_HOST=127.0.0.1:8888</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">那么就可以直接使用 docker ps  替代 docker -H 127.0.0.1:8888 ps -a。  docker info  替代 docker -H 127.0.0.1:8888 info</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><b>docker swarm 服务发现</b></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">swarm 支持多种服务发现机制， 上面使用token是一种简单的方式，这种方式会将集群节点信息保存到 docker 的服务器。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">此外， swarm 还支持：</div><div><ul><li style="text-align: left;font-size: 16px;">     使用静态文件描述的集群（Using a static file describing the cluster）</li><li style="text-align: left;"><font size="4">     etcd 服务发现</font></li><li style="text-align: left;"><font size="4">     consul 服务发现</font></li><li style="text-align: left;"><font size="4">     zookeeper 服务发现</font></li><li style="text-align: left;"><font size="4">     ip文件列表 （Using a static list of IP addresses）</font></li><li style="text-align: left;"><font size="4">     ip地址范围的表达式 （Range pattern for IP addresses）</font></li></ul><div style="text-align: left;"><font size="4">详细信息参考手册： </font><a href="http://docs.docker.com/swarm/discovery/" target="_blank" rel="external">http://docs.docker.com/swarm/discovery/</a></div></div><div style="text-align: left;"><br></div><div style="text-align: left;font-size: 16px;"><b>swarm filter 过滤</b></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">详细信息：<a href="http://docs.docker.com/swarm/scheduler/filter/" target="_blank" rel="external">http://docs.docker.com/swarm/scheduler/filter/</a></div><div style="text-align: left;"><br></div><div style="text-align: left;font-size: 16px;">docker 可以使用过滤条件， 这在调度任务的时候可以将任务运行在符合条件的机器上。 目前 swarm 支持 一下几种过滤：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">1、约束（Constraint）</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     在docker服务启动的时候，我们可以设置（by /etc/sysconfig/docker）当前节点的一些label信息， 例如：<span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">--label storage=ssd</span></div><div style="text-align: left;widows: 1; font-size: 16px;"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace"><span style="line-height: 24px; white-space: pre;"><br></span></font></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;"><font face="Consolas, Liberation Mono, Courier, monospace" style="color: rgb(51, 51, 51);">   </font>运行的时候， 我们指定 storage=ssd：</span></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;"><br></span></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;">           </span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; background-color: rgb(248, 248, 248);">docker</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre;">run</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; background-color: rgb(248, 248, 248);">-</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre;">d</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; background-color: rgb(248, 248, 248);">-P -</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre;">e</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre;">constraint</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; background-color: rgb(248, 248, 248);">:storage==ssd --name</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre;">db</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; background-color: rgb(248, 248, 248);">mysql</span></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;"><br></span></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;">      那么 新的容器就会运行在包含标签 storage=ssd 的机器上。</span></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;"><br></span></div><div style="text-align: left;widows: 1; font-size: 16px;"><span style="line-height: 24px; white-space: pre;">     详细示例：</span> <a href="http://docs.docker.com/swarm/scheduler/filter/#constraint-filter" target="_blank" rel="external">http://docs.docker.com/swarm/scheduler/filter/#constraint-filter</a></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">2、关系过滤（不知道怎么翻译， 原文是 Affinity filter， Affinity 百度翻译为 亲和力，我觉得称为关系更合适）</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     a、容器关系（Container affinity）</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">          容器关系，就是运行的时候可以指定类似于  <span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">-e affinity:container==&lt;container_name/container_id&gt;</span>的条件，表示将要运行的这个容器，需要运行在 包含指定容器名 的节点上。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          例如 有 A、B节点， A节点上面运行了一个redis 容器， 容器名叫做 redis， B节点也运行了一个 redis 容器，但是容器名叫做 redis_1, 我们要在集群中新运行一个服务：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">               <span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">docker run -d --name logger -e affinity:container==redis logger</span></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          这个时候，新的logger 将运行在 A 节点上面。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     b、镜像关系（Image affinity）</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          与上面的容器关系类似， 这个可以指定 将要运行的 服务只能运行在包含指定的 镜像名/镜像ID 的节点上：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">               <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">docker</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">run</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">-d</span> <span style="box-sizing: inherit; color: rgb(153, 153, 136); font-style: italic; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">--name redis1 -e affinity:image==mysql redis</span></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          此时， redis 将会运行在 包含 mysql 镜像的节点。</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     c、标签关系（Label affinity）</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          在运行一个服务的时候，我们可以给容器指定一个 label ：</div><div style="text-align: left;font-size: 16px;">     </div><div style="text-align: left;font-size: 16px;">               <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">docker run -d -</span><span style="box-sizing: inherit; color: rgb(0, 0, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">p</span> <span style="box-sizing: inherit; color: rgb(0, 128, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">80</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">:</span><span style="box-sizing: inherit; color: rgb(0, 128, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">80</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">--</span><span style="box-sizing: inherit; color: rgb(0, 0, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">label</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">com</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">.example</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">.type</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">=frontend nginx</span>容器指定一个</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          而使用标签关系，可以指定新运行的服务，要运行在包含指定的容器标签的节点上：</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">               <span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; line-height: 24px; white-space: pre; widows: 1;">docker run -d -e affinity:com.example.type==frontend logger</span></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">     d、表达式语法（Expression Syntax）</div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">          表达式包含一个key 和 value， key 必须是字母、数字、下划线组合，并且以字母开头。value 需要是下面一种：</div><div style="text-align: left;font-size: 16px;">          </div><div><ul style="font-size: 16px;"><li style="list-style: none; display: inline"><ul><li style="text-align: left;">字母、数字、点、连字符、下划线 组成的字符串</li><li style="text-align: left;">通配符模式， 像  abc*</li><li style="text-align: left;widows: 2;">正则表达式，格式  <span style="text-align: left; widows: 1; background-color: rgb(248, 248, 248);"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace"><span style="letter-spacing: 1px; line-height: 32px;">/regexp/ </span></font></span>现在支持Go语言的正则表达式语法</li></ul></li></ul><div style="text-align: left;font-size: 16px;">          目前swarm支持的操作符有 == 和 ！=， 例如：</div><div><ul><li style="list-style: none; display: inline"><ul style="font-size: 16px;"><li><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; widows: 1; background-color: rgb(248, 248, 248);">constraint:node==node1 匹配 node1</span></li><li><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; widows: 1; background-color: rgb(248, 248, 248);">constraint:node!=node1 匹配除了node1的所有节点</span></li><li><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; widows: 1; background-color: rgb(248, 248, 248);">constraint:region!=us* 匹配所有的节点，除了区域以 us 开头的</span></li><li><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; widows: 1; background-color: rgb(248, 248, 248);">constraint:node==/node[12]/ 匹配node1 和 node2</span></li><li><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; widows: 1; background-color: rgb(248, 248, 248);">constraint:node==/node\d/ 匹配所有的 node 和 一个数字 组成的节点</span></li><li><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; letter-spacing: 1px; line-height: 32px; text-align: left; widows: 1; background-color: rgb(248, 248, 248);">constraint:node!=/node-[01]/  匹配所有的几点，除了node0 和 node1</span></li></ul></li></ul><div style="text-align: left;"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px;">     其他的请参考官方文档上面的示例。</span></font></div></div><div style="text-align: left;"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4"><span style="letter-spacing: 1px; line-height: 32px;"><br></span></font></div><div style="text-align: left;"><span style="font-size: 16px;">     e、软约束/关联（</span><font size="4">Soft Affinities/Constraints</font><span style="font-size: 16px;">）</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">               默认的，上面的都是硬约束， 就是如果一个节点不满足条件，任务永远不会调度在这个节点上。 如果使用软约束， 那么调度的时候会先找符合条件的，</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">               如果没有符合条件的，那么swarm就会丢弃过滤条件按照 调度策略（见下文） 执行任务。</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">               启用软约束的方法就是在表达式中添加一个 ~ </span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">                    </span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">docker</span> <span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1;">run</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">-</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1;">d</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">--name redis1 -</span><span style="box-sizing: inherit; color: rgb(51, 51, 51); font-weight: bold; font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1;">e</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">affinity:image==</span><span style="font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);"><font color="#FF0000">~</font></span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">mysql redis</span><span style="font-size: 16px;">中添加一</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div></div><blockquote style="text-align: left;margin: 0px 0px 0px 40px; border: none; padding: 0px;"><font size="4">     上面的意思就是，如果集群中没有节点包含mysql， 那么就丢弃这个过滤条件而使用调度策略。</font></blockquote><div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">     e、端口过滤（</span><font size="4">Port Filter</font><span style="font-size: 16px;">）</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          在这种过滤中，端口被认为是一种唯一资源。 假如一个集群中有三个节点， 我们现在 A 节点运行：</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">               </span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">docker run -d -p</span> <span style="box-sizing: inherit; color: rgb(0, 128, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1;">80</span><span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">:</span><span style="box-sizing: inherit; color: rgb(0, 128, 128); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1;">80</span> <span style="color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; line-height: 24px; white-space: pre; widows: 1; background-color: rgb(248, 248, 248);">nginx</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          然后在集群中也启动redis， 并且占用80端口， 这时候， A 节点的80端口不能用了， 只能在B、C节点运行。加入此时运行在了B节点，</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          那么再次在集群中运行redis 的时候， 就只能运行在 C 节点，因为A、B节点的80已经不能用了。</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          如果再次运行redis， 占用80端口， 这个时候就会报错了。</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          详细信息：</span><a href="http://docs.docker.com/swarm/scheduler/filter/#port-filter" target="_blank" rel="external">http://docs.docker.com/swarm/scheduler/filter/#port-filter</a></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">     f、宿主模式的端口过滤（</span><font size="4">Port filter in Host Mode</font><span style="font-size: 16px;">）</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          示例请参考文档：</span><a href="http://docs.docker.com/swarm/scheduler/filter/#port-filter-in-host-mode" target="_blank" rel="external">http://docs.docker.com/swarm/scheduler/filter/#port-filter-in-host-mode</a></div><div style="text-align: left;"><br></div><div style="text-align: left;"><span style="font-size: 16px;">     g、容器依赖过滤（</span><font size="4">Dependency Filter</font><span style="font-size: 16px;">）</span></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><span style="font-size: 16px;">          示例文档： </span><a href="http://docs.docker.com/swarm/scheduler/filter/#dependency-filter" target="_blank" rel="external">http://docs.docker.com/swarm/scheduler/filter/#dependency-filter</a></div><div style="text-align: left;"><br></div><div style="text-align: left;">          </div><div style="text-align: left;"><b><font size="4">swarm strategy 调度策略</font></b></div><div style="text-align: left;"><span style="font-size: 16px;"><br></span></div><div style="text-align: left;"><font size="4">运行新服务的时候， 通过参数 </font><span style="background-color: rgb(248, 248, 248); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; font-size: 16px; letter-spacing: 1px; line-height: 25.6000003814697px; widows: 1;">--strategy 指定调度策略。</span><span style="font-size: large;">现在swarm支持三种策略： </span></div><ul style="box-sizing: inherit; margin: 0px 0px 1.25rem 1.1rem; padding: 0px; list-style: outside; widows: 1; background-color: rgb(255, 255, 255);"><li style="list-style: none; display: inline"><ul><li style="text-align: left;font-size: 16px; box-sizing: inherit; margin: 0px; padding: 0px; letter-spacing: 1px; line-height: 2; font-family: &apos;Helvetica Neue&apos;, Helvetica, Roboto, Arial, sans-serif; color: rgb(5, 14, 26);"><code style="box-sizing: inherit; border: 1px solid rgb(255, 203, 148); color: rgb(51, 51, 51); font-family: Consolas, &apos;Liberation Mono&apos;, Courier, monospace; padding: 0.125rem 0.3125rem 0.0625rem; background-color: rgb(248, 248, 248);">spread</code></li><li style="text-align: left;box-sizing: inherit; margin: 0px; padding: 0px;"><code style="box-sizing: inherit; border: 1px solid rgb(255, 203, 148); padding: 0.125rem 0.3125rem 0.0625rem; background-color: rgb(248, 248, 248); letter-spacing: 1px; line-height: 32px;"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4">binpack</font></code></li><li style="text-align: left;box-sizing: inherit; margin: 0px; padding: 0px;"><code style="box-sizing: inherit; border: 1px solid rgb(255, 203, 148); padding: 0.125rem 0.3125rem 0.0625rem; background-color: rgb(248, 248, 248); letter-spacing: 1px; line-height: 32px;"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace" size="4">random</font></code></li></ul></li></ul><div style="text-align: left;"><span style="font-size: large;">其中前两种策略会根据每个节点可用的cpu、内存、在运行的容器数目 计算出来一个排序。 而最后一种不进行任何计算，就是随机调度，通常用于调试。</span></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><span style="font-size: large;">spread 是 swarm 默认的调度策略。 它主要就是把任务尽可能的分散在多台机器上。当两台机器拥有相同的可用内存、cpu， spread策略会将新容器部署在任务较少的节点上。</span></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><span style="font-size: large;">相反，binpack 调度策略在两台机器有相同的可用内存、cpu的情况下， 会将新的容器运行在任务最多的那个机器上。</span></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><b><font size="4">swarm HA 高可用</font></b></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><span style="font-size: large;">swarm HA 就是指的启用多个swarm manager， 有一个manager挂了， 可以用其他的manager</span></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><font size="4">还没看： </font><a href="http://docs.docker.com/swarm/multi-manager-setup/" target="_blank" rel="external">http://docs.docker.com/swarm/multi-manager-setup/</a></div><div style="text-align: left;"><br></div><div style="text-align: left;"><a href="http://blog.liuts.com/post/242/" target="_blank" rel="external">http://blog.liuts.com/post/242/</a></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;font-size: 21px;"><b><br></b></div><div style="text-align: left;font-size: 21px;"><b>Docker Compose</b></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><span style="font-size: large;">Docker compose 是一种服务编排。帮助组织多个服务，一条命令启动多个关联的服务。 这个组件我还没怎么看。 详细文档： </span><a href="http://docs.docker.com/compose/" target="_blank" rel="external">http://docs.docker.com/compose/</a></div><div style="text-align: left;"><span style="font-size: large;"><br></span></div><div style="text-align: left;"><b style="font-size: 21px;">Docker Weave</b></div><div style="text-align: left;"><font size="4"><br></font></div><div style="text-align: left;"><font size="4">Docker Weave 是一种虚拟网络技术。 我按照github的文档实验没有成功， 不知道怎么回事。并且weave的官方文档（</font><a href="http://docs.weave.works/" target="_blank" rel="external">http://docs.weave.works/</a><span style="font-size: large;">）在墙外打不开。</span></div><div style="text-align: left;"><font size="4"><br></font></div><div style="text-align: left;"><font size="4">github项目主页： </font><a href="https://github.com/weaveworks/weave" target="_blank" rel="external">https://github.com/weaveworks/weave</a></div><div style="text-align: left;"><span style="font-size: 21px;"><b><br></b></span></div><div style="text-align: left;"><span style="font-size: 21px;"><b><br></b></span></div><div style="text-align: left;"><span style="font-size: 16px;"><b>目前问题</b></span></div><div style="text-align: left;"><span style="font-size: 16px;">1、Docker Weave 目前还不知道他的应用场景和使用方法？</span></div><div style="text-align: left;"><span style="font-size: 16px;">2、关于 swarm 的高可用， 目前没看是怎么用的</span></div><div style="text-align: left;"><span style="font-size: 16px;">3、</span><span style="font-size: 16px;">目前我们平台里面在代码里面用到了swarm， 但是还不清楚用途以及是怎么使用的？</span></div><div style="text-align: left;"><span style="font-size: 16px;">4、分布式部署的时候， 如何解决容器跨主机连接的问题？ 比如rabbitmq运行在 host1， gateway运行在host2， 如何解决 --rabbitmq:rabbitmq的问题</span><span style="font-size: 16px;"> ？</span></div><div style="text-align: left;"><span style="font-size: 16px;">     我知道 </span><font size="4">ambassador （</font><a href="http://docs.docker.com/articles/ambassador_pattern_linking/" target="_blank" rel="external">http://docs.docker.com/articles/ambassador_pattern_linking/</a><span style="font-size: large;">）是一种解决办法， 还有其他方案吗？ 比如使用weave 应该怎么做呢？</span></div><div style="text-align: left;"><span style="font-size: 16px;">5、有没有一些常用，关于docker的定位问题的方法（常用的 </span><font size="4">Troubleshooting 途径</font><span style="font-size: 16px;">）？</span></div><div style="text-align: left;"><span style="font-size: 16px;">6、Docker服务（Docker daemon）重启的时候， docker 会自动启动container， 能不能指定启动container的顺序？</span></div><div style="text-align: left;"><span style="font-size: 16px;">6、请Max看一下，还有哪些平台用到了但是上面还没有提到的？</span></div><div style="text-align: left;"><font size="4"><br></font></div></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;">docker swarm 简单示例：</div><div style="text-align: left;font-size: 16px;"><img src="https://wdwiki.mapbar.com/bin/download/%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91%E7%BB%84/DockerUsage/Image2.png" type="image/png" style="cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;"></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><img src="https://wdwiki.mapbar.com/bin/download/%E5%B9%B3%E5%8F%B0%E5%BC%80%E5%8F%91%E7%BB%84/DockerUsage/Image3.png" type="image/png" style="cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;cursor: default;"></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 16px;"><br></div><div style="text-align: left;font-size: 13px;"><br></div><div style="text-align: left;font-size: 13px;"><br></div><div style="text-align: left;font-size: 13px;"><br></div><div style="text-align: left;font-size: 13px;"><br></div><div style="text-align: left;font-size: 21px;"><b><br></b></div></div></div></span>
</div></a></body></html> 
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/images/docker-summery.html" data-id="cijzzpuzp00071cfshcwkn4mo" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/cache/">cache</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/">docker</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gis/">gis</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/git/">git</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/go/">go</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gradle/">gradle</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/groovy/">groovy</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hadoop/">hadoop</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/java/">java</a><span class="category-list-count">18</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/log/">log</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/">mongodb</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mq/">mq</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mybatis/">mybatis</a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/netty/">netty</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nginx/">nginx</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nio/">nio</a><span class="category-list-count">19</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/redis/">redis</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/rpc/">rpc</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/spring/">spring</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/tomcat/">tomcat</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zookeeper/">zookeeper</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/杂项/">杂项</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/aop/">aop</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/aspectj/">aspectj</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/classloader/">classloader</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/common-loggings/">common-loggings</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/commonjs/">commonjs</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dubbo/">dubbo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fastdfs/">fastdfs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gclib/">gclib</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geohash/">geohash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gis/">gis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gradle/">gradle</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/groovy/">groovy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hadoop/">hadoop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hessisan/">hessisan</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">48</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javassist/">javassist</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kafka/">kafka</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log/">log</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log4j/">log4j</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logback/">logback</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/map/">map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memecached/">memecached</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mina/">mina</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongodb/">mongodb</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mq/">mq</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mqtt/">mqtt</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mybatis/">mybatis</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netty/">netty</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nginx/">nginx</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nio/">nio</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/postgresql/">postgresql</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/proxy/">proxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/push/">push</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rabbitmq/">rabbitmq</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/">redis</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rpc/">rpc</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sitemesh/">sitemesh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sld/">sld</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/slf4j/">slf4j</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/socket/">socket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spatialite-for-android/">spatialite for android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spi/">spi</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spring/">spring</a><span class="tag-list-count">13</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tomcat/">tomcat</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/transaction/">transaction</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xSocket/">xSocket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zbus/">zbus</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zookeeper/">zookeeper</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/数据结构/">数据结构</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/aop/" style="font-size: 15.38px;">aop</a> <a href="/tags/aspectj/" style="font-size: 11.54px;">aspectj</a> <a href="/tags/cache/" style="font-size: 11.54px;">cache</a> <a href="/tags/classloader/" style="font-size: 10px;">classloader</a> <a href="/tags/common-loggings/" style="font-size: 10px;">common-loggings</a> <a href="/tags/commonjs/" style="font-size: 12.31px;">commonjs</a> <a href="/tags/database/" style="font-size: 16.92px;">database</a> <a href="/tags/docker/" style="font-size: 13.85px;">docker</a> <a href="/tags/dubbo/" style="font-size: 10px;">dubbo</a> <a href="/tags/fastdfs/" style="font-size: 10px;">fastdfs</a> <a href="/tags/gclib/" style="font-size: 10.77px;">gclib</a> <a href="/tags/geohash/" style="font-size: 10px;">geohash</a> <a href="/tags/gis/" style="font-size: 10px;">gis</a> <a href="/tags/git/" style="font-size: 10.77px;">git</a> <a href="/tags/go/" style="font-size: 10px;">go</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/groovy/" style="font-size: 10px;">groovy</a> <a href="/tags/hadoop/" style="font-size: 10px;">hadoop</a> <a href="/tags/hessisan/" style="font-size: 11.54px;">hessisan</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/javassist/" style="font-size: 10px;">javassist</a> <a href="/tags/kafka/" style="font-size: 11.54px;">kafka</a> <a href="/tags/linux/" style="font-size: 12.31px;">linux</a> <a href="/tags/log/" style="font-size: 17.69px;">log</a> <a href="/tags/log4j/" style="font-size: 12.31px;">log4j</a> <a href="/tags/logback/" style="font-size: 13.08px;">logback</a> <a href="/tags/map/" style="font-size: 10px;">map</a> <a href="/tags/memecached/" style="font-size: 10.77px;">memecached</a> <a href="/tags/mina/" style="font-size: 13.08px;">mina</a> <a href="/tags/mongodb/" style="font-size: 19.23px;">mongodb</a> <a href="/tags/mq/" style="font-size: 13.85px;">mq</a> <a href="/tags/mqtt/" style="font-size: 10.77px;">mqtt</a> <a href="/tags/mybatis/" style="font-size: 16.15px;">mybatis</a> <a href="/tags/netty/" style="font-size: 10px;">netty</a> <a href="/tags/nginx/" style="font-size: 11.54px;">nginx</a> <a href="/tags/nio/" style="font-size: 13.08px;">nio</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/postgresql/" style="font-size: 10.77px;">postgresql</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/proxy/" style="font-size: 10px;">proxy</a> <a href="/tags/push/" style="font-size: 10px;">push</a> <a href="/tags/rabbitmq/" style="font-size: 11.54px;">rabbitmq</a> <a href="/tags/redis/" style="font-size: 13.85px;">redis</a> <a href="/tags/rpc/" style="font-size: 19.23px;">rpc</a> <a href="/tags/sitemesh/" style="font-size: 10px;">sitemesh</a> <a href="/tags/sld/" style="font-size: 10px;">sld</a> <a href="/tags/slf4j/" style="font-size: 10px;">slf4j</a> <a href="/tags/socket/" style="font-size: 14.62px;">socket</a> <a href="/tags/spatialite-for-android/" style="font-size: 10px;">spatialite for android</a> <a href="/tags/spi/" style="font-size: 10px;">spi</a> <a href="/tags/spring/" style="font-size: 18.46px;">spring</a> <a href="/tags/tomcat/" style="font-size: 10.77px;">tomcat</a> <a href="/tags/transaction/" style="font-size: 10px;">transaction</a> <a href="/tags/web/" style="font-size: 10px;">web</a> <a href="/tags/xSocket/" style="font-size: 14.62px;">xSocket</a> <a href="/tags/zbus/" style="font-size: 10px;">zbus</a> <a href="/tags/zookeeper/" style="font-size: 10.77px;">zookeeper</a> <a href="/tags/数据结构/" style="font-size: 10.77px;">数据结构</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a><span class="archive-list-count">67</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a><span class="archive-list-count">81</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a><span class="archive-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/01/30/资料/">(no title)</a>
          </li>
        
          <li>
            <a href="/2016/01/30/java/13.Classloader系列一/">ClassLoader系列一</a>
          </li>
        
          <li>
            <a href="/2016/01/29/hadoop/1.hadoop系列之源码编译/">hadoop系列一之源码编译</a>
          </li>
        
          <li>
            <a href="/2016/01/29/go/1.GO系列之入门/">Go系列一之入门</a>
          </li>
        
          <li>
            <a href="/2016/01/28/tomcat/2.tomcat性能优化/">tomcat性能优化</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

  </div>
</body>
</html>